CC = g++
CFLAGS = -Wall -g $(shell pkg-config --cflags lilv-0)
FLAGS = -Wl,-export-dynamic -g3
LIBS = -ljack -lreadline -lncurses -lrt -ldl -lm -ldl $(shell pkg-config --libs lilv-0)
MAIN = ssq 

MODULES = s7.o TextException.o UnitManager.o Script.o Unit.o JackClient.o SynthUnits.o LV2Unit.o

$(MAIN): main.cpp $(MODULES)
	$(CC) main.cpp $(MODULES) -o $(MAIN) $(FLAGS) $(CFLAGS) $(LIBS)

%.o: %.cpp %.h
	$(CC) -c $< $(CFLAGS) $(INCL)

s7.o: s7/s7.c s7/s7.h
	gcc -c s7/s7.c -I./s7 -g3

Script.o: Script.h Script.cpp ScriptNatives.cpp
	$(CC) -c Script.cpp $(CFLAGS)

clean:
	rm -f *.o

clear: clean
	rm -f $(MAIN)
	rm -f wxtest
	rm -f myforth

re: clear $(MAIN)

help:
	@ echo "Usage: make [ssq|clean|clear|re]"

wxtest: WxMain.cpp
	$(CC) $< $(CFLAGS) $(shell wx-config --cppflags) $(shell wx-config --libs) -o wxtest

myforth: myforth.c
	gcc -o myforth -Wall -g myforth.c -lm -lreadline
